<!DOCTYPE html>
<html>
<head>
<title>部门表</title>
<meta charset="UTF-8">
#parse("sys/header.html")
<link href="${rc.contextPath}/js/B-JUI/themes/css/style.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/themes/blue/core.css" id="bjui-link-theme" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/themes/css/fontsize.css" id="bjui-link-theme" rel="stylesheet">

<link href="${rc.contextPath}/js/B-JUI/plugins/kindeditor_4.1.11/themes/default/default.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/plugins/nice-validator-1.0.7/jquery.validator.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/plugins/bootstrapSelect/bootstrap-select.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/plugins/webuploader/webuploader.css" rel="stylesheet">
<link href="${rc.contextPath}/js/B-JUI/themes/css/FA/css/font-awesome.min.css" rel="stylesheet">
<script src="${rc.contextPath}/js/B-JUI/js/bjui-all.js"></script>

<script src="${rc.contextPath}/js/B-JUI/plugins/nice-validator-1.0.7/jquery.validator.js"></script>
<script src="${rc.contextPath}/js/B-JUI/plugins/nice-validator-1.0.7/jquery.validator.themes.js"></script>

<script src="${rc.contextPath}/js/B-JUI/plugins/bootstrapSelect/bootstrap-select.min.js"></script>
<script src="${rc.contextPath}/js/B-JUI/plugins/bootstrapSelect/defaults-zh_CN.min.js"></script> -->
<script src="${rc.contextPath}/js/B-JUI/plugins/bootstrap.min.js"></script>
<script src="${rc.contextPath}/js/B-JUI/plugins/bootstrapSelect/bootstrap-select.min.js"></script>
<script src="${rc.contextPath}/js/B-JUI/plugins/bootstrapSelect/defaults-zh_CN.min.js"></script>

<script src="${rc.contextPath}/js/B-JUI/plugins/icheck/icheck.min.js"></script>
<script src="${rc.contextPath}/js/laydate/laydate.js"></script>
<style>
.btn-group.bootstrap-select.show-tick{
	z-index: 1212121212
}
</style>
</head>
<body>
<div class="bjui-pageContent">
          <input type="file" id="uploadFile" style="display:none" name="uploadFile"/>   
    <table class="table table-bordered" id="j_datagrid_tree" >
        <thead>
            <tr>
                <th data-options="{name:'name', align:'center', width:300, rule:'required'}">部门名称</th>
                <th data-options="{name:'id',align:'center',width:80,hide:true}">操作列</th>
                <th data-options="{render:datagrid_tree_operation}">操作列</th>
            </tr>
        </thead>
    </table>
</div>


	
<script src="${rc.contextPath}/js/zjdc/dictdepartment.js?_${date.systemTime}"></script>
<script type="text/javascript">
$(function(){
var costom =
"<button type='button' id='imp' class='btn btn-blue' onclick='imp()' style='margin-left:10px' data-icon='sign-in'><i class='fa fa-sign-in'></i> 导入excel</button>"+
"<button type='button' id='sureup' class='btn btn-blue' onclick='up()' style='display:none;margin-left:10px' data-icon='sign-in'><i class='fa fa-sign-in'></i>&nbsp;确认</button>"+
"<code style='margin-top:4px;float:right'><a href='${rc.contextPath}/information/dictdepartment.xlsx' target='blank'>获取模板</a></code>";
	$('#j_datagrid_tree').datagrid({
		dataUrl: '../dictdepartment/treelist',
        delUrl:'../dictdepartment/delete',
        delType:'GET',
        editType:'GET',
        delPK:'id',
        editUrl:'../dictdepartment/update',
        editMode:'inline',
        local : 'remote',
        filterThead:false,
        filterAll:true,
        loadType:'get',
        dataType:'json',
        width: '100%',		
        height: '100%', 
        gridTitle: '部门列表',
        showToolbar: true,
        //toolbarItem:'add,edit,del,cancel, save',
        //toolbarCustom:costom,
        inlineEditMult: false,
        isTree: 'name',
        fieldSortable: false,
        columnMenu: false,
        paging: false,
        editCallback:function(json, options)
        {
         if(json.code!=0){
              BJUI.alertmsg('error', json.msg, {
              okCall: function() {
              $('#j_datagrid_tree').datagrid('reload');
              }
              })
              }else{
              $('#j_datagrid_tree').datagrid('reload');
              }  

        },
        delCallback:function(json, options)
        {
        	if(json.code!=0){
                BJUI.alertmsg('error', json.msg, {
                okCall: function() {
                $('#j_datagrid_tree').datagrid('reload');
                }
                })
                }else{
                $('#j_datagrid_tree').datagrid('reload');
                }

        },
        treeOptions:
        {
            expandAll: false,
            add: false, 
            simpleData: true,
            keys: {
            	key:'deptNo',
            	level: 'level', 
                parentKey: 'fid'
            }
        },
        columns: [
            {name:'name',label:'名称',align:'center',width:300},
  	           {name:'deptNo',label:'部门编号',align:'center',width:80},  
	            {name:'empName',label:'负责人',align:'center',width:80} 
        ]
	});
	 $("#imp").parent().css("width","99%")
})

</script>

<script type="text/javascript">

</script>
</body>
</html>